package org.crackjack.android.model;

import java.io.Serializable;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Category that can have many appointments.
 * One appointment can have just one category.
 * Example of category:
 * health,household services
 * 
 * @author Dmitry Kalachov
 * 
 */
public class Category extends Identify implements Serializable, Parcelable {

    private static final long serialVersionUID = -8534447526785295863L;
    private String name;

    public static final Parcelable.Creator<Category> CREATOR = new Parcelable.Creator<Category>() {
        @Override
        public Category createFromParcel(Parcel in) {
            return new Category(in);
        }

        @Override
        public Category[] newArray(int size) {
            return new Category[size];
        }
    };

    private Category(Parcel parcel) {
        id = parcel.readLong();
        name = parcel.readString();
    }

    public Category() {

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeLong(id);
        dest.writeString(name);
    }

}
